import request from '@/utils/request'

// ========================== 楼层相关接口 ==========================
// 查询楼层列表
export function listFloor(query) {
  return request({
    url: '/system/floor/list',
    method: 'get',
    params: query
  })
}

// 查询楼层详细信息
export function getFloor(id) {
  return request({
    url: '/system/floor/' + id,
    method: 'get'
  })
}

// 新增楼层
export function addFloor(data) {
  return request({
    url: '/system/floor',
    method: 'post',
    data: data
  })
}

// 修改楼层
export function updateFloor(data) {
  return request({
    url: '/system/floor',
    method: 'put',
    data: data
  })
}

// 删除楼层
export function delFloor(id) {
  return request({
    url: '/system/floor/' + id,
    method: 'delete'
  })
}

// 导出楼层列表
export function exportFloor(query) {
  return request({
    url: '/system/floor/export',
    method: 'post',
    params: query,
    responseType: 'blob' // 导出文件需指定响应类型为Blob
  })
}

// 查询所有楼层全链路关联数据
export function listFloorAllRelations() {
  return request({
    url: '/system/floor/all-relations',
    method: 'get'
  })
}

// 根据楼层ID查询单条全链路数据
export function getFloorRelationsById(id) {
  return request({
    url: '/system/floor/all-relations/' + id,
    method: 'get'
  })
}

// ========================== 房型设置相关接口 ==========================
// 查询房型设置列表
export function listType(query) {
  return request({
    url: '/system/type/list',
    method: 'get',
    params: query
  })
}

// 查询房型设置详细
export function getType(id) {
  return request({
    url: '/system/type/' + id,
    method: 'get'
  })
}

// 新增房型设置
export function addType(data) {
  return request({
    url: '/system/type',
    method: 'post',
    data: data
  })
}

// 修改房型设置
export function updateType(data) {
  return request({
    url: '/system/type',
    method: 'put',
    data: data
  })
}

// 删除房型设置
export function delType(id) {
  return request({
    url: '/system/type/' + id,
    method: 'delete'
  })
}

// 导出房型设置列表
export function exportType(query) {
  return request({
    url: '/system/type/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

// ========================== 房间相关接口 ==========================
// 查询房间列表
export function listRoom(query) {
  return request({
    url: '/system/room/list',
    method: 'get',
    params: query
  })
}

// 查询房间详细
export function getRoom(id) {
  return request({
    url: '/system/room/' + id,
    method: 'get'
  })
}

// 新增房间
export function addRoom(data) {
  return request({
    url: '/system/room',
    method: 'post',
    data: data
  })
}

// 修改房间
export function updateRoom(data) {
  return request({
    url: '/system/room',
    method: 'put',
    data: data
  })
}

// 删除房间
export function delRoom(id) {
  return request({
    url: '/system/room/' + id,
    method: 'delete'
  })
}

// 导出房间列表
export function exportRoom(query) {
  return request({
    url: '/system/room/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

// ========================== 床位相关接口 ==========================
// 查询床位列表
export function listBed(query) {
  return request({
    url: '/system/bed/list',
    method: 'get',
    params: query
  })
}

// 查询床位详细
export function getBed(id) {
  return request({
    url: '/system/bed/' + id,
    method: 'get'
  })
}

// 新增床位
export function addBed(data) {
  return request({
    url: '/system/bed',
    method: 'post',
    data: data
  })
}

// 修改床位
export function updateBed(data) {
  return request({
    url: '/system/bed',
    method: 'put',
    data: data
  })
}

// 删除床位
export function delBed(id) {
  return request({
    url: '/system/bed/' + id,
    method: 'delete'
  })
}

// 导出床位列表
export function exportBed(query) {
  return request({
    url: '/system/bed/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

// ========================== 老人相关接口 ==========================
// 查询老人列表
export function listElderly(query) {
  return request({
    url: '/system/elderly/list',
    method: 'get',
    params: query
  })
}

// 查询老人详细
export function getElderly(id) {
  return request({
    url: '/system/elderly/' + id,
    method: 'get'
  })
}

// 新增老人
export function addElderly(data) {
  return request({
    url: '/system/elderly',
    method: 'post',
    data: data
  })
}

// 修改老人
export function updateElderly(data) {
  return request({
    url: '/system/elderly',
    method: 'put',
    data: data
  })
}

// 删除老人
export function delElderly(id) {
  return request({
    url: '/system/elderly/' + id,
    method: 'delete'
  })
}

// 导出老人列表
export function exportElderly(query) {
  return request({
    url: '/system/elderly/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

// ========================== 请假相关接口 ==========================
// 查询请假列表
export function listLeaveRequest(query) {
  return request({
    url: '/system/request/list',
    method: 'get',
    params: query
  })
}

// 查询请假详细
export function getLeaveRequest(id) {
  return request({
    url: '/system/request/' + id,
    method: 'get'
  })
}

// 新增请假
export function addLeaveRequest(data) {
  return request({
    url: '/system/request',
    method: 'post',
    data: data
  })
}

// 修改请假
export function updateLeaveRequest(data) {
  return request({
    url: '/system/request',
    method: 'put',
    data: data
  })
}

// 删除请假
export function delLeaveRequest(id) {
  return request({
    url: '/system/request/' + id,
    method: 'delete'
  })
}

// 导出请假列表
export function exportLeaveRequest(query) {
  return request({
    url: '/system/request/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

// ========================== 护理等级相关接口 ==========================
// 查询护理等级列表
export function listNursingLevel(query) {
  return request({
    url: '/system/level/list',
    method: 'get',
    params: query
  })
}

// 查询护理等级详细
export function getNursingLevel(id) {
  return request({
    url: '/system/level/' + id,
    method: 'get'
  })
}

// 新增护理等级
export function addNursingLevel(data) {
  return request({
    url: '/system/level',
    method: 'post',
    data: data
  })
}

// 修改护理等级
export function updateNursingLevel(data) {
  return request({
    url: '/system/level',
    method: 'put',
    data: data
  })
}

// 删除护理等级
export function delNursingLevel(id) {
  return request({
    url: '/system/level/' + id,
    method: 'delete'
  })
}

// 导出护理等级列表
export function exportNursingLevel(query) {
  return request({
    url: '/system/level/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}